import time

from selenium import webdriver

driver = webdriver.Chrome()
driver.get('https://www.baidu.com/')
driver.maximize_window()

# 添加和登录相关的cookie
cookies = [
    {
        'name': 'BDUSS',
        'value': 'h1R3JmWklxdG42eVY5Q1NIUUFCakxkSFpzbVFNTFh4YU05Z0pDUWlYVFRzT05pRUFBQUFBJCQAAAAAAAAAAAEAAADwqgd-eWhzaHNreGpmdwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANMjvGLTI7xiND'
    },
    {
        'name': 'BDUSS_BFESS',
        'value': 'h1R3JmWklxdG42eVY5Q1NIUUFCakxkSFpzbVFNTFh4YU05Z0pDUWlYVFRzT05pRUFBQUFBJCQAAAAAAAAAAAEAAADwqgd-eWhzaHNreGpmdwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANMjvGLTI7xiND'
    }
]

driver.add_cookie(cookies[0])
driver.add_cookie(cookies[1])
driver.get('https://www.baidu.com/')
driver.refresh()
time.sleep(5)

driver.quit()
